/*
Copyright 2010, KISSY UI Library v1.1.6
MIT Licensed
build time: Dec 14 18:02
*/
KISSY.add("suggest",function(f,n){function l(a,b,c){if(!(this instanceof l))return new l(a,b,c);this.textInput=f.get(a);this.config=c=f.merge(y,c);b+=b.indexOf("?")===-1?"?":"&";this.dataSource=b+c.callbackName+"="+(a=c.callbackFn);if(a!==u){c=a;a=c.split(".");b=a.length;if(b>1){c=c.replace(/^(.*)\..+$/,"$1");c=f.namespace(c,true);c[a[b-1]]=q}else r[c]=q}this.queryParams=this.query=k;this._dataCache={};this._init()}function v(a,b){if(b.nodeType===1){d.html(a,k);a.appendChild(b)}else d.html(a,b)}function q(a){l.focusInstance&&
f.later(function(){l.focusInstance._handleResponse(a)},0)}var d=f.DOM,j=f.Event,r=window,o=document,p,w=f.get("head"),s=f.UA.ie,u="KISSY.Suggest.callback",k="",x=parseInt,z=/^(?:input|button|a)$/i,y={containerCls:k,resultFormat:"%result%",closeBtnText:"\u5173\u95ed",shim:s===6,submitOnSelect:true,offset:-1,charset:"utf-8",callbackName:"callback",callbackFn:u,queryName:"q"};f.augment(l,f.EventTarget,{_init:function(){p=o.body;this._initTextInput();this._initContainer();this.config.shim&&this._initShim();this._initStyle();
this._initEvent()},_initTextInput:function(){var a=this,b=a.textInput,c=false,e=0;d.attr(b,"autocomplete","off");a.config.autoFocus&&b.focus();j.on(b,"keydown",function(h){var i=h.keyCode;if(i===27){a.hide();b.value=a.query}else if(i>32&&i<41)if(b.value){if(i===40||i===38){if(e++===0){a._isRunning&&a.stop();c=true;a._selectItem(i===40)}else if(e==3)e=0;h.preventDefault()}}else b.blur();else if(i===13){b.blur();if(c)if(b.value==a._getSelectedItemKey())if(a.fire("itemSelect")===false)return;a._submitForm()}else{a._isRunning||
a.start();c=false}});j.on(b,"keyup",function(){e=0});j.on(b,"blur",function(){a.stop();f.later(function(){a._focusing||a.hide()},0)})},_initContainer:function(){var a=this.config.containerCls;a=d.create("<div>",{"class":"ks-suggest-container"+(a?" "+a:k),style:"position:absolute;visibility:hidden"});var b=d.create("<div>",{"class":"ks-suggest-content"}),c=d.create("<div>",{"class":"ks-suggest-footer"});a.appendChild(b);a.appendChild(c);p.insertBefore(a,p.firstChild);this.container=a;this.content=
b;this.footer=c;this._initContainerEvent()},_setContainerRegion:function(){var a=this.config,b=this.textInput,c=d.offset(b),e=this.container;d.offset(e,{left:c.left,top:c.top+b.offsetHeight+a.offset});d.width(e,a.containerWidth||b.offsetWidth-2)},_initContainerEvent:function(){var a=this,b=a.textInput,c=a.container,e=a.content,h=a.footer,i,t;j.on(e,"mousemove",function(g){g=g.target;if(g.nodeName!=="LI")g=d.parent(g,"li");if(d.contains(e,g))if(g!==a.selectedItem){a._removeSelectedItem();a._setSelectedItem(g)}});
j.on(e,"mousedown",function(g){g=g.target;if(g.nodeName!=="LI")g=d.parent(g,"li");i=g});j.on(c,"mousedown",function(g){if(!z.test(g.target.nodeName)){b.onbeforedeactivate=function(){r.event.returnValue=false;b.onbeforedeactivate=null};g.preventDefault()}});j.on(e,"mouseup",function(g){var m=g.target;if(!(g.which>2)){if(m.nodeName!=="LI")m=d.parent(m,"li");if(m==i)if(d.contains(e,m)){a._updateInputFromSelectItem(m);if(a.fire("itemSelect")!==false){b.blur();a._submitForm()}}}});j.on(h,"focusin",function(){a._focusing=
true;a._removeSelectedItem();t=false});j.on(h,"focusout",function(){a._focusing=false;f.later(function(){if(t)a.hide();else a._focusing||a.textInput.focus()},0)});j.on(a.container,"mouseleave",function(){t=true});j.on(h,"click",function(g){d.hasClass(g.target,"ks-suggest-closebtn")&&a.hide()})},_submitForm:function(){if(this.config.submitOnSelect){var a=this.textInput.form;if(a)if(this.fire("beforeSubmit",{form:a})!==false){if(o.createEvent){var b=o.createEvent("MouseEvents");b.initEvent("submit",
true,false);a.dispatchEvent(b)}else o.createEventObject&&a.fireEvent("onsubmit");a.submit()}}},_initShim:function(){var a=d.create("<iframe>",{src:"about:blank","class":"ks-suggest-shim",style:"position:absolute;visibility:hidden;border:none"});this.container.shim=a;p.insertBefore(a,p.firstChild)},_setShimRegion:function(){var a=this.container,b=a.style,c=a.shim;c&&d.css(c,{left:x(b.left)-2,top:b.top,width:x(b.width)+2,height:d.height(a)-2})},_initStyle:function(){f.get("#ks-suggest-style")||d.addStyleSheet(".ks-suggest-container{background:white;border:1px solid #999;z-index:99999}.ks-suggest-shim{z-index:99998}.ks-suggest-container li{color:#404040;padding:1px 0 2px;font-size:12px;line-height:18px;float:left;width:100%}.ks-suggest-container .ks-selected{background-color:#39F;cursor:default}.ks-suggest-key{float:left;text-align:left;padding-left:5px}.ks-suggest-result{float:right;text-align:right;padding-right:5px;color:green}.ks-suggest-container .ks-selected span{color:#FFF;cursor:default}.ks-suggest-footer{padding:0 5px 5px}.ks-suggest-closebtn{float:right}.ks-suggest-container li,.ks-suggest-footer{overflow:hidden;zoom:1;clear:both}.ks-suggest-container{*margin-left:2px;_margin-left:-2px;_margin-top:-3px}",
"ks-suggest-style")},_initEvent:function(){var a=this;j.on(r,"resize",function(){a._setContainerRegion();a._setShimRegion()})},start:function(){var a=this;if(a.fire("beforeStart")!==false){l.focusInstance=a;a._timer=f.later(function(){a._updateContent();a._timer=f.later(arguments.callee,200)},200);a._isRunning=true}},stop:function(){l.focusInstance=n;this._timer&&this._timer.cancel();this._isRunning=false},show:function(){if(!this.isVisible()){var a=this.container,b=a.shim;this._setContainerRegion();
a.style.visibility=k;if(b){this._setShimRegion();b.style.visibility=k}}},hide:function(){if(this.isVisible()){var a=this.container,b=a.shim;if(b)b.style.visibility="hidden";a.style.visibility="hidden"}},isVisible:function(){return this.container.style.visibility!="hidden"},_updateContent:function(){var a=this.textInput;if(a.value!=this.query){a=this.query=a.value;if(f.trim(a))if(this._dataCache[a]!==n){this._fillContainer(this._dataCache[a]);this._displayContainer()}else this._requestData();else{this._fillContainer();
this.hide()}}},_requestData:function(){var a=this,b=a.config,c;if(!s)a.dataScript=n;if(!a.dataScript){c=o.createElement("script");c.charset=b.charset;c.async=true;w.insertBefore(c,w.firstChild);a.dataScript=c;if(!s){var e=f.now();a._latestScriptTime=e;d.attr(c,"data-time",e);j.on(c,"load",function(){a._scriptDataIsOut=d.attr(c,"data-time")!=a._latestScriptTime})}}a.queryParams=b.queryName+"="+encodeURIComponent(a.query);if(a.fire("beforeDataRequest")!==false)a.dataScript.src=a.dataSource+"&"+a.queryParams},
_handleResponse:function(a){var b=k,c,e,h,i;if(!this._scriptDataIsOut){this.returnedData=a;if(this.fire("dataReturn",{data:a})!==false){a=this._formatData(this.returnedData);if((c=a.length)>0){e=d.create("<ol>");for(b=0;b<c;++b){h=a[b];h=this._formatItem(i=h.key,h.result);d.attr(h,"key",i);d.addClass(h,b%2?"ks-even":"ks-odd");e.appendChild(h)}b=e}this._fillContainer(b);if(this.fire("beforeShow")!==false){this._dataCache[this.query]=d.html(this.content);this._displayContainer()}}}},_formatData:function(a){var b=
[],c,e,h,i=0;if(!a)return b;if(f.isArray(a.result))a=a.result;if(!(c=a.length))return b;for(h=0;h<c;++h){e=a[h];if(f.isString(e))b[i++]={key:e};else if(f.isArray(e)&&e.length>1)b[i++]={key:e[0],result:e[1]}}return b},_formatItem:function(a,b){var c=d.create("<li>"),e;c.appendChild(d.create("<span>",{"class":"ks-suggest-key",html:a}));if(b){e=this.config.resultFormat.replace("%result%",b);f.trim(e)&&c.appendChild(d.create("<span>",{"class":"ks-suggest-result",html:e}))}return c},_fillContainer:function(a,
b){this._fillContent(a||k);this._fillFooter(b||k)},_fillContent:function(a){v(this.content,a);this.selectedItem=n},_fillFooter:function(a){var b=this.config,c=this.footer;v(c,a);b.closeBtn&&c.appendChild(d.create("<a>",{"class":"ks-suggest-closebtn",text:b.closeBtnText,href:"javascript: void(0)",target:"_self"}));this.fire("updateFooter",{footer:c,query:this.query});d.css(c,"display",d.text(c)?k:"none")},_displayContainer:function(){f.trim(d.text(this.container))?this.show():this.hide()},_selectItem:function(a){var b=
f.query("li",this.container);if(b.length!==0)if(this.isVisible()){if(this.selectedItem){a=d[a?"next":"prev"](this.selectedItem);if(!a)this.textInput.value=this.query}else a=b[a?0:b.length-1];this._removeSelectedItem();if(a){this._setSelectedItem(a);this._updateInputFromSelectItem()}}else this.show()},_removeSelectedItem:function(){d.removeClass(this.selectedItem,"ks-selected");this.selectedItem=n},_setSelectedItem:function(a){d.addClass(a,"ks-selected");this.selectedItem=a;this.textInput.focus()},
_getSelectedItemKey:function(){if(!this.selectedItem)return k;return d.attr(this.selectedItem,"key")},_updateInputFromSelectItem:function(){this.textInput.value=this._getSelectedItemKey(this.selectedItem)||this.query}});l.version=1.1;l.callback=q;f.Suggest=l},{requires:["core"]});
/*
Copyright 2010, KISSY UI Library v1.1.6
MIT Licensed
build time: Dec 14 18:01
*/
KISSY.add("anim-easing",function(d){var t=Math,o=t.PI,h=t.pow,w=t.sin,l=1.70158,r={easeNone:function(a){return a},easeIn:function(a){return a*a},easeOut:function(a){return(2-a)*a},easeBoth:function(a){return(a*=2)<1?0.5*a*a:0.5*(1- --a*(a-2))},easeInStrong:function(a){return a*a*a*a},easeOutStrong:function(a){return 1- --a*a*a*a},easeBothStrong:function(a){return(a*=2)<1?0.5*a*a*a*a:0.5*(2-(a-=2)*a*a*a)},elasticIn:function(a){if(a===0||a===1)return a;return-(h(2,10*(a-=1))*w((a-0.075)*2*o/0.3))},
elasticOut:function(a){if(a===0||a===1)return a;return h(2,-10*a)*w((a-0.075)*2*o/0.3)+1},elasticBoth:function(a){if(a===0||(a*=2)===2)return a;if(a<1)return-0.5*h(2,10*(a-=1))*w((a-0.1125)*2*o/0.45);return h(2,-10*(a-=1))*w((a-0.1125)*2*o/0.45)*0.5+1},backIn:function(a){if(a===1)a-=0.0010;return a*a*((l+1)*a-l)},backOut:function(a){return(a-=1)*a*((l+1)*a+l)+1},backBoth:function(a){if((a*=2)<1)return 0.5*a*a*(((l*=1.525)+1)*a-l);return 0.5*((a-=2)*a*(((l*=1.525)+1)*a+l)+2)},bounceIn:function(a){return 1-
r.bounceOut(1-a)},bounceOut:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375},bounceBoth:function(a){if(a<0.5)return r.bounceIn(a*2)*0.5;return r.bounceOut(a*2-1)*0.5+0.5}};r.NativeTimeFunction={easeNone:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeBoth:"ease-in-out",easeInStrong:"cubic-bezier(0.9, 0.0, 0.9, 0.5)",easeOutStrong:"cubic-bezier(0.1, 0.5, 0.1, 1.0)",easeBothStrong:"cubic-bezier(0.9, 0.0, 0.1, 1.0)"};
d.Easing=r});
KISSY.add("anim",function(d,t){function o(b,c,e,i,f,g){if(b=d.get(b)){if(!(this instanceof o))return new o(b,c,e,i,f,g);var k=d.isPlainObject(e);c=c;this.domEl=b;if(d.isPlainObject(c))c=d.param(c,";").replace(/=/g,":").replace(/%23/g,"#").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();var x={},z=A.length,u;m.innerHTML='<div style="'+c+'"></div>';for(b=m.firstChild.style;z--;)if(u=b[A[z]])x[A[z]]=l(u);this.props=x;this.targetStyle=c;if(k)k=d.merge(v,e);else{k=d.clone(v);if(e)k.duration=p(e)||1;if(d.isString(i)||
d.isFunction(i))k.easing=i;if(d.isFunction(f))k.complete=f;if(g!==t)k.nativeSupport=g}this.config=k;if(k.nativeSupport&&h()&&d.isString(i=k.easing))if(/cubic-bezier\([\s\d.,]+\)/.test(i)||(i=q.NativeTimeFunction[i])){k.easing=i;this.transitionName=h()}d.isFunction(f)&&this.on(n,f)}}function h(){var b="transition",c;if(m.style[b]!==t)c=b;else d.each(["Webkit","Moz","O"],function(e){if(m.style[b=e+"Transition"]!==t){c=b;return false}});h=function(){return c};return c}function w(b,c,e){d.UA.ie&&e.indexOf(j)>
-1&&s.css(b,j,c[j].v);b.style.cssText+=";"+e}function l(b){var c=p(b);b=(b+"").replace(/^[-\d.]+/,"");return isNaN(c)?{v:b,u:"",f:a}:{v:c,u:b,f:r}}function r(b,c,e){return(b+(c-b)*e).toFixed(3)}function a(b,c,e){for(var i=2,f,g,k=[],x=[];f=3,g=arguments[i-1],i--;)if(g.substr(0,4)==="rgb(")for(g=g.match(/\d+/g);f--;)k.push(~~g[f]);else if(g.substr(0,1)==="#"){if(g.length===4)g="#"+g.substr(1,1)+g.substr(1,1)+g.substr(2,1)+g.substr(2,1)+g.substr(3,1)+g.substr(3,1);for(;f--;)k.push(parseInt(g.substr(1+
f*2,2),16))}else return c;for(;f--;){i=~~(k[f+3]+(k[f]-k[f+3])*e);x.push(i<0?0:i>255?255:i)}return"rgb("+x.join(",")+")"}var s=d.DOM,q=d.Easing,p=parseFloat,m=s.create("<div>"),A="backgroundColor borderBottomColor borderBottomWidth borderBottomStyle borderLeftColor borderLeftWidth borderLeftStyle borderRightColor borderRightWidth borderRightStyle borderSpacing borderTopColor borderTopWidth borderTopStyle bottom color font fontFamily fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex".split(" "),
j="opacity",n="complete",v={duration:1,easing:"easeNone",nativeSupport:true};d.augment(o,d.EventTarget,{run:function(){var b=this,c=b.config,e=b.domEl,i,f,g,k,x=b.props,z={},u;for(u in x)z[u]=l(s.css(e,u));if(b.fire("start")!==false){b.stop();if(b.transitionName)b._nativeRun();else{i=c.duration*1E3;g=d.now();k=g+i;f=c.easing;if(d.isString(f))f=q[f]||q.easeNone;b.timer=d.later(c=function(){var C=d.now(),E=C>k?1:(C-g)/i,B,y,D;for(u in x){B=z[u];y=x[u];if(y.v==0)y.u=B.u;if(B.u!==y.u)B.v=0;s.css(e,u,
y.f(B.v,y.v,f(E))+y.u)}if(b.fire("step")===false||(D=C>k)){b.stop();D&&b.fire(n)}},13,true);c()}return b}},_nativeRun:function(){var b=this,c=b.config,e=b.domEl,i=b.props,f=c.duration*1E3;c=c.easing;var g=b.transitionName,k={};k[g+"Property"]="all";k[g+"Duration"]=f+"ms";k[g+"TimingFunction"]=c;s.css(e,k);d.later(function(){w(e,i,b.targetStyle)},0);d.later(function(){b.stop(true)},f)},stop:function(b){if(this.transitionName)this._nativeStop(b);else{if(this.timer){this.timer.cancel();this.timer=t}if(b){w(this.domEl,
this.props,this.targetStyle);this.fire(n)}}return this},_nativeStop:function(b){var c=this.domEl,e=this.transitionName,i=this.props,f;if(b){s.css(c,e+"Property","none");this.fire(n)}else{for(f in i)s.css(c,f,s._getComputedStyle(c,f));s.css(c,e+"Property","none")}}});o.supportTransition=function(){return!!h()};d.Anim=o});
KISSY.add("anim-node-plugin",function(d,t){function o(j,n,v,b,c){if(n==="toggle"){c=h.css(j,l)===r?1:0;n="show"}if(c)h.css(j,l,h.data(j,l)||"");var e={},i={};d.each(A[n],function(f){if(f===a){e[a]=h.css(j,a);h.css(j,a,s)}else if(f===q){e[q]=h.css(j,q);i.opacity=c?1:0;c&&h.css(j,q,0)}else if(f===p){e[p]=h.css(j,p);i.height=c?h.css(j,p)||j.naturalHeight:0;c&&h.css(j,p,0)}else if(f===m){e[m]=h.css(j,m);i.width=c?h.css(j,m)||j.naturalWidth:0;c&&h.css(j,m,0)}});(new d.Anim(j,i,v,"easeOut",function(){if(!c){var f=
j.style,g=f[l];if(g!==r){g&&h.data(j,l,g);f[l]=r}e[p]&&h.css(j,{height:e[p]});e[m]&&h.css(j,{height:e[m]});e[q]&&h.css(j,{height:e[q]});e[a]&&h.css(j,{height:e[a]})}b&&d.isFunction(b)&&b()})).run()}var h=d.DOM,w=d.Anim,l="display",r="none",a="overflow",s="hidden",q="opacity",p="height",m="width",A={show:[a,q,p,m],fade:[q],slide:[a,p]};d.each([d.Node.prototype,d.NodeList.prototype],function(j){j.animate=function(){var n=d.makeArray(arguments);d.each(this,function(v){w.apply(t,[v].concat(n)).run()});
return this};d.each({show:["show",1],hide:["show",0],toggle:["toggle"],fadeIn:["fade",1],fadeOut:["fade",0],slideDown:["slide",1],slideUp:["slide",0]},function(n,v){j[v]=function(b,c){h[v]&&arguments.length===0?h[v](this):d.each(this,function(e){o(e,n[0],b,c,n[1])});return this}})})});
/*
Copyright 2010, KISSY UI Library v1.1.6
MIT Licensed
build time: Dec 14 18:02
*/
KISSY.add("switchable",function(c,k){function i(a,b){b=b||{};if(!("markupType"in b))if(b.panelCls)b.markupType=1;else if(b.panels)b.markupType=2;b=c.merge(i.Config,b);this.container=c.get(a);this.config=b;this.activeIndex=b.activeIndex;this._init()}var l=c.DOM,g=c.Event;i.Config={markupType:0,navCls:"ks-switchable-nav",contentCls:"ks-switchable-content",triggerCls:"ks-switchable-trigger",panelCls:"ks-switchable-panel",triggers:[],panels:[],hasTriggers:true,triggerType:"mouse",delay:0.1,activeIndex:0,
activeTriggerCls:"ks-active",steps:1,viewSize:[]};i.Plugins=[];c.augment(i,c.EventTarget,{_init:function(){var a=this,b=a.config;a._parseMarkup();b.switchTo&&a.switchTo(b.switchTo);b.hasTriggers&&a._bindTriggers();c.each(i.Plugins,function(d){d.init&&d.init(a)});a.fire("init")},_parseMarkup:function(){var a=this.container,b=this.config,d,f=[],h=[];switch(b.markupType){case 0:if(d=c.get("."+b.navCls,a))f=l.children(d);d=c.get("."+b.contentCls,a);h=l.children(d);break;case 1:f=c.query("."+b.triggerCls,
a);h=c.query("."+b.panelCls,a);break;case 2:f=b.triggers;h=b.panels}a=h.length;this.length=a/b.steps;if(b.hasTriggers&&a>0&&f.length===0)f=this._generateTriggersMarkup(this.length);this.triggers=c.makeArray(f);this.panels=c.makeArray(h);this.content=d||h[0].parentNode},_generateTriggersMarkup:function(a){var b=this.config,d=l.create("<ul>"),f,h;d.className=b.navCls;for(h=0;h<a;h++){f=l.create("<li>");if(h===this.activeIndex)f.className=b.activeTriggerCls;f.innerHTML=h+1;d.appendChild(f)}this.container.appendChild(d);
return l.children(d)},_bindTriggers:function(){var a=this,b=a.config,d=a.triggers,f,h,e=d.length;for(h=0;h<e;h++)(function(j){f=d[j];g.on(f,"click",function(){a._onFocusTrigger(j)});if(b.triggerType==="mouse"){g.on(f,"mouseenter",function(){a._onMouseEnterTrigger(j)});g.on(f,"mouseleave",function(){a._onMouseLeaveTrigger(j)})}})(h)},_onFocusTrigger:function(a){if(this._triggerIsValid(a)){this._cancelSwitchTimer();this.switchTo(a)}},_onMouseEnterTrigger:function(a){var b=this;if(b._triggerIsValid(a))b.switchTimer=
c.later(function(){b.switchTo(a)},b.config.delay*1E3)},_onMouseLeaveTrigger:function(){this._cancelSwitchTimer()},_triggerIsValid:function(a){return this.activeIndex!==a},_cancelSwitchTimer:function(){if(this.switchTimer){this.switchTimer.cancel();this.switchTimer=k}},switchTo:function(a,b){var d=this.config,f=this.triggers,h=this.panels,e=this.activeIndex,j=d.steps,p=e*j,m=a*j;if(!this._triggerIsValid(a))return this;if(this.fire("beforeSwitch",{toIndex:a})===false)return this;if(d.hasTriggers)this._switchTrigger(e>
-1?f[e]:null,f[a]);if(b===k)b=a>e?"forward":"backward";this._switchView(h.slice(p,p+j),h.slice(m,m+j),a,b);this.activeIndex=a;return this},_switchTrigger:function(a,b){var d=this.config.activeTriggerCls;a&&l.removeClass(a,d);l.addClass(b,d)},_switchView:function(a,b,d){l.css(a,"display","none");l.css(b,"display","block");this._fireOnSwitch(d)},_fireOnSwitch:function(a){this.fire("switch",{currentIndex:a})},prev:function(){var a=this.activeIndex;this.switchTo(a>0?a-1:this.length-1,"backward")},next:function(){var a=
this.activeIndex;this.switchTo(a<this.length-1?a+1:0,"forward")}});c.Switchable=i},{requires:["core"]});
KISSY.add("autoplay",function(c,k){var i=c.Event,l=c.Switchable;c.mix(l.Config,{autoplay:false,interval:5,pauseOnHover:true});l.Plugins.push({name:"autoplay",init:function(g){function a(){f=c.later(function(){g.paused||g.switchTo(g.activeIndex<g.length-1?g.activeIndex+1:0,"forward")},d,true)}var b=g.config,d=b.interval*1E3,f;if(b.autoplay){if(b.pauseOnHover){i.on(g.container,"mouseenter",function(){g.stop();g.paused=true});i.on(g.container,"mouseleave",function(){g.paused=false;a()})}a();g.stop=function(){if(f){f.cancel();
f=k}}}}})},{host:"switchable"});
KISSY.add("effect",function(c,k){var i=c.DOM,l=c.Anim,g=c.Switchable,a;c.mix(g.Config,{effect:"none",duration:0.5,easing:"easeNone",nativeAnim:true});g.Effects={none:function(b,d,f){i.css(b,"display","none");i.css(d,"display","block");f()},fade:function(b,d,f){b.length!==1&&c.error("fade effect only supports steps == 1.");var h=this,e=h.config,j=b[0],p=d[0];h.anim&&h.anim.stop(true);i.css(p,"opacity",1);h.anim=(new l(j,{opacity:0},e.duration,e.easing,function(){h.anim=k;i.css(p,"z-index",9);i.css(j,
"z-index",1);f()},e.nativeAnim)).run()},scroll:function(b,d,f,h){var e=this;b=e.config;d=b.effect==="scrollx";var j={};j[d?"left":"top"]=-(e.viewSize[d?0:1]*h)+"px";e.anim&&e.anim.stop();e.anim=(new l(e.content,j,b.duration,b.easing,function(){e.anim=k;f()},b.nativeAnim)).run()}};a=g.Effects;a.scrollx=a.scrolly=a.scroll;g.Plugins.push({name:"effect",init:function(b){var d=b.config,f=d.effect,h=b.panels,e=b.content,j=d.steps,p=b.activeIndex,m=h.length;b.viewSize=[d.viewSize[0]||h[0].offsetWidth*j,
d.viewSize[1]||h[0].offsetHeight*j];if(f!=="none"){c.each(h,function(q){i.css(q,"display","block")});switch(f){case "scrollx":case "scrolly":i.css(e,"position","absolute");i.css(e.parentNode,"position","relative");if(f==="scrollx"){i.css(h,"float","left");i.width(e,b.viewSize[0]*(m/j))}break;case "fade":var r=p*j,s=r+j-1,o;c.each(h,function(q,t){o=t>=r&&t<=s;i.css(q,{opacity:o?1:0,position:"absolute",zIndex:o?9:1})})}}}});c.augment(g,{_switchView:function(b,d,f,h){var e=this,j=e.config.effect;(c.isFunction(j)?
j:a[j]).call(e,b,d,function(){e._fireOnSwitch(f)},f,h)}})},{host:"switchable"});
KISSY.add("circular",function(c,k){function i(o,q,t,u,w){var n=this;o=n.config;q=n.length;var x=n.activeIndex,v=o.scrollType===r,y=v?f:h,z=n.viewSize[v?0:1];v=-z*u;var B={},C,A=w===m;if(C=A&&x===0&&u===q-1||w===p&&x===q-1&&u===0)v=l.call(n,n.panels,u,A,y,z);B[y]=v+j;n.anim&&n.anim.stop();n.anim=(new c.Anim(n.content,B,o.duration,o.easing,function(){C&&g.call(n,n.panels,u,A,y,z);n.anim=k;t()},o.nativeAnim)).run()}function l(o,q,t,u,w){var n=this.config.steps;q=this.length;var x=t?q-1:0,v=(x+1)*n;for(n=
x*n;n<v;n++){a.css(o[n],b,d);a.css(o[n],u,(t?-1:1)*w*q)}return t?w:-w*q}function g(o,q,t,u,w){var n=this.config.steps;q=this.length;var x=t?q-1:0,v=(x+1)*n;for(n=x*n;n<v;n++){a.css(o[n],b,e);a.css(o[n],u,e)}a.css(this.content,u,t?-w*(q-1):e)}var a=c.DOM,b="position",d="relative",f="left",h="top",e="",j="px",p="forward",m="backward",r="scrollx",s=c.Switchable;c.mix(s.Config,{circular:false});s.Plugins.push({name:"circular",init:function(o){o=o.config;if(o.circular&&(o.effect===r||o.effect==="scrolly")){o.scrollType=
o.effect;o.effect=i}}})},{host:"switchable"});
KISSY.add("lazyload",function(c){var k=c.DOM,i="beforeSwitch",l="img-src",g="area-data",a={},b=c.Switchable;a[l]="data-ks-lazyload-custom";a[g]="ks-datalazyload-custom";c.mix(b.Config,{lazyDataType:g});b.Plugins.push({name:"lazyload",init:function(d){function f(m){var r=e.steps;m=m.toIndex*r;h.loadCustomLazyData(d.panels.slice(m,m+r),j);a:{var s,o;if(m=(r=j===l)?"img":j===g?"textarea":""){m=c.query(m,d.container);s=0;for(o=m.length;s<o;s++)if(r?k.attr(m[s],p):k.hasClass(m[s],p)){r=false;break a}}r=
true}r&&d.detach(i,f)}var h=c.DataLazyload,e=d.config,j=e.lazyDataType,p=a[j];!h||!j||!p||d.on(i,f)}})},{host:"switchable"});KISSY.add("autorender",function(c){c.Switchable.autoRender=function(k,i){k="."+(k||"KS_Widget");c.query(k,i).each(function(l){var g=l.getAttribute("data-widget-type"),a;if(g&&"Switchable Tabs Slide Carousel Accordion".indexOf(g)>-1)try{if(a=l.getAttribute("data-widget-config"))a=a.replace(/'/g,'"');new c[g](l,c.JSON.parse(a))}catch(b){}})}},{host:"switchable"});
KISSY.add("tabs",function(c){function k(i,l){if(!(this instanceof k))return new k(i,l);k.superclass.constructor.call(this,i,l)}c.extend(k,c.Switchable);c.Tabs=k},{host:"switchable"});KISSY.add("slide",function(c){function k(l,g){if(!(this instanceof k))return new k(l,g);k.superclass.constructor.call(this,l,c.merge(i,g))}var i={autoplay:true,circular:true};c.extend(k,c.Switchable);c.Slide=k},{host:"switchable"});
KISSY.add("carousel",function(c,k){function i(e,j){var p=this;if(!(p instanceof i))return new i(e,j);p.on("init",function(){l(p)});i.superclass.constructor.call(p,e,c.merge(h,j))}function l(e){var j=e.config,p=j.disableBtnCls;c.each(["prev","next"],function(m){var r=e[m+"Btn"]=c.get(b+j[m+"BtnCls"],e.container);a.on(r,"click",function(s){s.preventDefault();g.hasClass(r,p)||e[m]()})});j.circular||e.on("switch",function(m){m=m.currentIndex;m=m===0?e[d]:m===e.length-1?e[f]:k;g.removeClass([e[d],e[f]],
p);m&&g.addClass(m,p)});a.on(e.panels,"click focus",function(){e.fire("itemSelected",{item:this})})}var g=c.DOM,a=c.Event,b=".",d="prevBtn",f="nextBtn",h={circular:true,prevBtnCls:"ks-switchable-prev-btn",nextBtnCls:"ks-switchable-next-btn",disableBtnCls:"ks-switchable-disable-btn"};c.extend(i,c.Switchable);c.Carousel=i},{host:"switchable"});
KISSY.add("accordion",function(c){function k(g,a){if(!(this instanceof k))return new k(g,a);k.superclass.constructor.call(this,g,c.merge(l,a));if(this.config.multiple)this._switchTrigger=function(){}}var i=c.DOM,l={markupType:1,triggerType:"click",multiple:false};c.extend(k,c.Switchable);c.Accordion=k;c.augment(k,{_triggerIsValid:function(g){return this.activeIndex!==g||this.config.multiple},_switchView:function(g,a,b){var d=this.config,f=a[0];if(d.multiple){i.toggleClass(this.triggers[b],d.activeTriggerCls);
i.css(f,"display",f.style.display=="none"?"block":"none");this._fireOnSwitch(b)}else k.superclass._switchView.call(this,g,a,b)}})},{host:"switchable"});
/*
Copyright 2010, KISSY UI Library v1.1.6
MIT Licensed
build time: Dec 14 18:01
*/
KISSY.add("datalazyload",function(c,r){function i(a,b){if(!(this instanceof i))return new i(a,b);if(b===r){b=a;a=[m]}c.isArray(a)||(a=[c.get(a)||m]);this.containers=a;this.config=c.merge(s,b);this.callbacks={els:[],fns:[]};this._init()}var f=c.DOM,k=c.Event,l=window,m=document,n="scroll",o="resize",s={mod:"manual",diff:"default",placeholder:"none"};c.augment(i,{_init:function(){this.threshold=this._getThreshold();this._filterItems();this._initLoadEvent()},_filterItems:function(){var a=this.containers,
b,d,e,h=[],g=[];b=0;for(d=a.length;b<d;++b){e=c.query("img",a[b]);h=h.concat(c.filter(e,this._filterImg,this));e=c.query("textarea",a[b]);g=g.concat(c.filter(e,this._filterArea,this))}this.images=h;this.areaes=g},_filterImg:function(a){var b=a.getAttribute("data-ks-lazyload"),d=this.threshold,e=this.config.placeholder;if(this.config.mod==="manual"){if(b){if(e!=="none")a.src=e;return true}}else if(f.offset(a).top>d&&!b){f.attr(a,"data-ks-lazyload",a.src);if(e!=="none")a.src=e;else a.removeAttribute("src");
return true}},_filterArea:function(a){return f.hasClass(a,"ks-datalazyload")},_initLoadEvent:function(){function a(){d||(d=c.later(function(){b();d=null},100))}function b(){e._loadItems();if(e._getItemsLength()===0){k.remove(l,n,a);k.remove(l,o,h)}}var d,e=this,h;k.on(l,n,a);k.on(l,o,h=function(){e.threshold=e._getThreshold();a()});e._getItemsLength()&&c.ready(function(){b()})},_loadItems:function(){this._loadImgs();this._loadAreas();this._fireCallbacks()},_loadImgs:function(){this.images=c.filter(this.images,
this._loadImg,this)},_loadImg:function(a){var b=this.threshold+f.scrollTop();if(f.offset(a).top<=b)this._loadImgSrc(a);else return true},_loadImgSrc:function(a,b){b=b||"data-ks-lazyload";var d=a.getAttribute(b);if(d&&a.src!=d){a.src=d;a.removeAttribute(b)}},_loadAreas:function(){this.areaes=c.filter(this.areaes,this._loadArea,this)},_loadArea:function(a){var b=f.css(a,"display")==="none";if(f.offset(b?a.parentNode:a).top<=this.threshold+f.scrollTop())this._loadAreaData(a.parentNode,a);else return true},
_loadAreaData:function(a,b){b.style.display="none";b.className="";var d=f.create("<div>");a.insertBefore(d,b);f.html(d,b.value,true)},_fireCallbacks:function(){var a=this.callbacks,b=a.els,d=a.fns,e=this.threshold+f.scrollTop(),h,g,j,p=[],q=[];for(h=0;(g=b[h])&&(j=d[h++]);)if(f.offset(g).top<=e)j.call(g);else{p.push(g);q.push(j)}a.els=p;a.fns=q},addCallback:function(a,b){var d=this.callbacks;if((a=c.get(a))&&c.isFunction(b)){d.els.push(a);d.fns.push(b)}},_getThreshold:function(){var a=this.config.diff,
b=f.viewportHeight();return a==="default"?2*b:b+ +a},_getItemsLength:function(){return this.images.length+this.areaes.length+this.callbacks.els.length},loadCustomLazyData:function(a,b){var d=this,e,h;c.isArray(a)||(a=[c.get(a)]);c.each(a,function(g){switch(b){case "img-src":h=g.nodeName==="IMG"?[g]:c.query("img",g);c.each(h,function(j){d._loadImgSrc(j,"data-ks-lazyload-custom")});break;default:(e=c.get("textarea",g))&&f.hasClass(e,"ks-datalazyload-custom")&&d._loadAreaData(g,e)}})}});c.mix(i,i.prototype,
true,["loadCustomLazyData","_loadImgSrc","_loadAreaData"]);c.DataLazyload=i},{requires:["core"]});
/*
Copyright 2010, KISSY UI Library v1.1.6
MIT Licensed
build time: Dec 14 18:01
*/
KISSY.add("ajax",function(d,B){function i(a){a=d.merge(J,a);if(a.url){if(a.data&&!d.isString(a.data))a.data=d.param(a.data);a.context=a.context||a;var b,e=n,g,f=a.type.toUpperCase();if(a.dataType===w){b=a.jsonpCallback||w+d.now();a.url=a.url+(a.url.indexOf("?")===-1?"?":"&")+(a.jsonp+"="+b);a.dataType=C;var o=j[b];j[b]=function(k){if(d.isFunction(o))o(k);else{j[b]=B;try{delete j[b]}catch(h){}}p([n,q],k,e,c,a)}}if(a.data&&f===x)a.url=a.url+(a.url.indexOf("?")===-1?"?":"&")+a.data;if(a.dataType===C){l(D,
a);f=d.getScript(a.url,b?null:function(){p([n,q],t,e,c,a)});l(E,a);return f}var r=false,c=a.xhr();l(D,a);c.open(f,a.url,a.async);try{if(a.data||a.contentType)c.setRequestHeader(F,a.contentType);c.setRequestHeader("Accept",a.dataType&&a.accepts[a.dataType]?a.accepts[a.dataType]+", */*; q=0.01":a.accepts._default)}catch(L){}c.onreadystatechange=function(k){if(!c||c.readyState===0||k==="abort"){r||p(q,null,s,c,a);r=true;if(c)c.onreadystatechange=G}else if(!r&&c&&(c.readyState===4||k===u)){r=true;c.onreadystatechange=
G;var h;if(k===u)h=u;else{a:{try{h=c.status>=200&&c.status<300||c.status===304||c.status===1223;break a}catch(M){}h=false}h=h?n:s}e=h;try{h=c;var v=a.dataType,y=t,H,m=h;if(!d.isString(m)){y=h.getResponseHeader(F)||t;m=(H=v==="xml"||!v&&y.indexOf("xml")>=0)?h.responseXML:h.responseText;if(H&&m.documentElement.nodeName===z)throw z;}if(d.isString(m))if(v===A||!v&&y.indexOf(A)>=0)m=d.JSON.parse(m);g=m}catch(N){e=z}p([e===n?n:s,q],g,e,c,a);if(k===u){c.abort();l(K,a)}if(a.async)c=null}};l(E,a);try{c.send(f===
I?a.data:null)}catch(O){p([s,q],g,s,c,a)}a.async||l(q,a);return c}}function p(a,b,e,g,f){if(d.isArray(a))d.each(a,function(o){p(o,b,e,g,f)});else{e===a&&f[a]&&f[a].call(f.context,b,e,g);l(a,f)}}function l(a,b){i.fire(a,{ajaxConfig:b})}var j=window,G=function(){},x="GET",I="POST",F="Content-Type",A="json",w=A+"p",C="script",t="",D="start",E="send",K="stop",n="success",q="complete",s="error",u="timeout",z="parsererror",J={type:x,url:t,contentType:"application/x-www-form-urlencoded",async:true,data:null,
xhr:j.ActiveXObject?function(){if(j.XmlHttpRequest)try{return new j.XMLHttpRequest}catch(a){}try{return new j.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}:function(){return new j.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"},jsonp:"callback"};d.mix(i,d.EventTarget);d.mix(i,{get:function(a,b,e,g,f){if(d.isFunction(b)){g=e;e=b}return i({type:f||x,
url:a,data:b,success:function(o,r,c){e&&e.call(this,o,r,c)},dataType:g})},post:function(a,b,e,g){if(d.isFunction(b)){g=e;e=b;b=B}return i.get(a,b,e,g,I)},jsonp:function(a,b,e){if(d.isFunction(b)){e=b;b=null}return i.get(a,b,e,w)}});i.getScript=d.getScript;d.io=d.ajax=i.ajax=i;d.jsonp=i.jsonp;d.IO=i});
